home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
HYP
/
T-Z
/
XCMDInfo.cpt
/
Flash.p
< prev
next >
Wrap
Text File
|
1989-02-26
|
1KB
|
66 lines
{$R-}
(*
flash -- a sample HyperCard external command.
©Apple Computer, Inc. 1987
All Rights Reserved.
To compile and link this file using Macintosh Programmer's Workshop
(HyperXCmd.p and XCmdGlue.inc must be accessible):
pascal Flash.p
link -o HyperCommands -rt XCMD=0 -sn Main=Flash Flash.p.o
then use ResEdit to copy the resulting XCMD from HyperCommands
and paste it into the Home stack, or your own stack.
When you build your own XCMDs, if you need to load
"{MPW}"Libraries:interface.o, then say -m ENTRYPOINT in the link statement
to filter out all routines you don't use.
*)
{$S Flash } { Segment name must be the same as the command name. }
UNIT DummyUnit;
INTERFACE
USES MemTypes, QuickDraw, HyperXCmd;
PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
IMPLEMENTATION
TYPE Str31 = String[31];
PROCEDURE Flash(paramPtr: XCmdPtr); FORWARD;
PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
BEGIN
Flash(paramPtr);
END;
PROCEDURE Flash(paramPtr: XCmdPtr);
VAR flashCount: LongInt;
i: INTEGER;
port: GrafPtr;
str: Str255;
{$I XCmdGlue.inc }
BEGIN
ZeroToPas(paramPtr^.params[1]^,str); { first param is flash count }
flashCount := StrToNum(str);
GetPort(port);
FOR i := 1 TO flashCount DO
BEGIN
InvertRect(port^.portRect);
InvertRect(port^.portRect);
END;
END;
END.